package com.entor.hqj.main;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.entor.hqj.login.LoginActivity;
import com.entor.hqj.login.R;
import com.entor.hqj.util.AlterUtil;
import com.entor.hqj.util.TitleBuilder;

public class SetupActivity extends Activity implements View.OnClickListener{

    private Button editInfo,editPwd,loginOut;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setup);
        editInfo = (Button)findViewById(R.id.btn_editInfo);
        editInfo.setOnClickListener(this);
        editPwd = (Button)findViewById(R.id.btn_editPwd);
        editPwd.setOnClickListener(this);
        loginOut = (Button)findViewById(R.id.btn_loginOut);
        loginOut.setOnClickListener(this);
        initTitle();
    }

    public void initTitle(){
        new TitleBuilder(this).setLeftText("返回")
        .setLeftImgOrTextListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.btn_editInfo:
                Intent i1 = new Intent(SetupActivity.this,EditInfoActivity.class);
                startActivity(i1);
                break;
            case R.id.btn_editPwd:
                Intent i2 = new Intent(SetupActivity.this,EditPwdActivity.class);
                startActivity(i2);
                break;
            case R.id.btn_loginOut:
                AlterUtil au = new AlterUtil(SetupActivity.this);
               au.dialogShowOkCancel();

                break;
            case R.id.title_left_textview:
                finish();
                break;
        }
    }



}
